
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.IDN;

public class Find extends JPanel implements ActionListener {
    private JButton backBtn;
    private Atmtest frame;
    private JLabel titleLabel = new JLabel();

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);

    }

    public Find(Atmtest frame) {
        this.frame = frame;
        this.setLayout(null);
        this.setOpaque(false);

        titleLabel.setBounds(150, 500, 100, 30);
        this.add(titleLabel);


        backBtn = new JButton(Util.getIcon("/img/buttonOff.jpg"));
        backBtn.setBounds(900, 330, 100, 50);
        this.add(backBtn);
        backBtn.addActionListener(this);

    }

    public void setname() {
        titleLabel.setText("账号" + frame.getUsers().get(frame.getID()).getBalance());
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (backBtn == e.getSource()) {
            frame.switchPanel("menu");
        }
    }
}